﻿using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Xml.Linq;

namespace Spotted
{
    public partial class App : Application
    {
        public App()
        {
            // Standard Silverlight initialization
            InitializeComponent();
        }

        // global properties
        public IList<string> AvailableStates
        {
            get
            {
                if (_stateList == null || _stateList.Count == 0)
                {
                    _stateList = (from node in XElement.Load("StateList.xml").Elements("State")
                                  select node.Value).ToList();
                }

                return _stateList;
            }
        }

        private IList<string> _stateList;
    }
}